﻿using System.Windows;
using System.Windows.Controls;
using System.Linq;
using Office = Microsoft.Office.Core;
using PPT = Microsoft.Office.Interop.PowerPoint;
using System;
using System.Diagnostics;

namespace An_Im
{
    /// <summary>
    /// AnImMainControl.xaml 的交互逻辑
    /// </summary>
    public partial class AnImMainControl : UserControl
    {
        public ItemsControl AnimList => itemsControls_lv1;


        public AnImMainControl()
        {
            InitializeComponent();
        }

        private void MenuItem_Click(object sender, RoutedEventArgs e)
        {
            var button = sender as FrameworkElement;
            if (button != null)
            {
                var dataContext = button.DataContext as EffectInformation;
                if (modeSwitch.IsChecked == false)
                    CoreManipulator.DeleteAllAnimationsAttachedShapeRange();

                var tag1 = dataContext.Tags[0];
                var tag = CoreManipulator.TagDictionary[tag1];

                CoreManipulator.AddTargetAnimationOnSelectionShapeRange(dataContext, tag.AnimEffect);

            }
        }

        private void AnButton_Click(object sender, RoutedEventArgs e)
        {
            if(CoreManipulator.HasSaveFile)
                Process.Start(CoreManipulator.SavePath);
        }
    }
}
